package com.handsome.外观模式;

/**
 * 外观类
 *
 * @author niechun
 * @date 2023/3/2 20:10
 */
public class Home {
    private Player player;
    private Popcorn popcorn;
    private Projector projector;

    public Home() {
        this.player = Player.getInstance();
        this.popcorn = Popcorn.getInstance();
        this.projector = Projector.getInstance();
    }

    public void ready() {
        player.on();
        projector.on();
        popcorn.on();
        projector.play();
        popcorn.make();
    }

    public void play() {
        player.play();
    }

    public void end() {
        popcorn.off();
        projector.off();
        player.off();
    }

}
